package com.education.api.controller.admin.system;

import com.education.business.service.education.StudentExamTestPaperService;
import com.education.common.annotation.Param;
import com.education.common.utils.Result;
import com.education.model.entity.StudentExamTestPaper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RestController
public class StudentExamTestPaperController {
    @Autowired
    private StudentExamTestPaperService studentExamTestPaperService;

    @GetMapping(value = "/selectStudentExamTestPaper")
    public Result selectStudentExamTestPaper(StudentExamTestPaper studentExamTestPaper){

        return Result.success(studentExamTestPaperService.selectStudentExamTestPaper(studentExamTestPaper.getStudentId()));
    }

    @GetMapping(value = "/addStudentToPaper")
    public Result addStudentToPaper( StudentExamTestPaper studentExamTestPaper){

        return  Result.success(studentExamTestPaperService.save(studentExamTestPaper));
    }
    @GetMapping(value = "/deleteStudentToPaper")
    public Result deleteStudentToPaper(@RequestParam("id") Integer id){

        return  Result.success(studentExamTestPaperService.deleteById(id));
    }
}
